package com.share;

import hipro.entities.EventCategories;
import hipro.event.Events;
import android.app.AlertDialog;
import android.content.SharedPreferences;
import android.os.Bundle;

public class CategoryActivity extends BaseActivity{
	private String username;
	private String password;
	private hipro.event.Events webserviceEvents;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.event_list);

		// set view events
		webserviceEvents = new Events();
		webserviceEvents.setWebservice(getString(R.string.webservice_event));

		this.setValueAccount();
		//this.showCountry();
		this.getCategoryById();
	}
	
	private void getCategoryById(){
		hipro.entities.EventCategories eventCategory = new EventCategories();
		eventCategory = webserviceEvents.getCategoryById(this.username,
				this.password, 1);
		
		AlertDialog al = new AlertDialog.Builder(this).create();
		al.setMessage(eventCategory.getEventCategoryName());
		al.show();
	}
	
	/**
	 * Set value account login
	 */
	private void setValueAccount() {
		SharedPreferences settings = getSharedPreferences("pref_login", 0);
		this.username = settings.getString("username", "");
		this.password = settings.getString("password", "");

	}
}
